﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2006"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
	xmlns:Models="clr-namespace:Danilins.Multitouch.ConfigurationTool.Models"
	xmlns:Commands="clr-namespace:Danilins.Multitouch.Common.Commands;assembly=Danilins.Multitouch.Common"
	xmlns:al="clr-namespace:Avalon.Windows.Controls;assembly=AvalonLibrary"
	x:Class="Danilins.Multitouch.ConfigurationTool.MainWindow"
	x:Name="window"
    Title="Touch device configuration"
	DataContext="{DynamicResource MainModelDS}"
	ShowInTaskbar="{Binding Path=WindowState, Converter={StaticResource winStateConverter}, ElementName=window}"
	Width="300" Height="300"
	>
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition />
		</Grid.RowDefinitions>
		<Grid.ColumnDefinitions>
			<ColumnDefinition />
			<ColumnDefinition />
		</Grid.ColumnDefinitions>
		<al:NotifyIcon x:Name="notifyIcon"
					   Icon="Resources\MultitouchTransparent.png"
					   Click="notifyIcon_Click" Grid.ColumnSpan="2" Grid.RowSpan="2"/>
		<ComboBox IsSynchronizedWithCurrentItem="True" MinWidth="100" ItemsSource="{Binding Path=Providers, Mode=Default}" SelectedItem="{Binding Path=SelectedProvider, Mode=Default}"/>
		<StackPanel Grid.Row="1" Grid.ColumnSpan="2" Margin="5">
			<CheckBox IsChecked="{Binding IsEnabledOnStart}"
					  Content="{Binding Path=EnableOnStart.Command.Text, FallbackValue=enable on start (nb)}"
					  Command="{Binding Path=EnableOnStart.Command}"
					  Commands:CreateCommandBinding.Command="{Binding EnableOnStart}"/>
		</StackPanel>
		<Button Grid.Column="1"
				Content="{Binding Path=ShowConfiguration.Command.Text, Mode=Default, FallbackValue=configure (nb)}"
				Command="{Binding Path=ShowConfiguration.Command, Mode=Default}"
				Commands:CreateCommandBinding.Command="{Binding ShowConfiguration}"/>
		<Button Grid.Row="2" Grid.Column="0"
				Content="{Binding Path=StartMultitouch.Command.Text, Mode=Default, FallbackValue=start (nb)}"
				Command="{Binding Path=StartMultitouch.Command, Mode=Default}"
				Commands:CreateCommandBinding.Command="{Binding StartMultitouch}"/>
		<Button Grid.Row="2" Grid.Column="1"
				Content="{Binding Path=StopMultitouch.Command.Text, Mode=Default, FallbackValue=stop (nb)}"
				Command="{Binding Path=StopMultitouch.Command, Mode=Default}"
				Commands:CreateCommandBinding.Command="{Binding StopMultitouch}"/>
	</Grid>
</Window>